<template>
  <h1>{{ name }}</h1>
  <button @click="f1">修改人的信息</button>
  <h3>工作种类:{{ job.type }}</h3>
  <h3>工作薪水:{{ job.salary }}</h3>
</template>

<script>
import {ref} from 'vue'
export default {
  name: "App",
  setup() {
    let name = ref('张三')  //ref加工后的name变为一个引用对象
    let job=ref({
      type:'前端工程师',
      salary:'30k'
    })

    function f1() {
      console.log(name); 
      name.value='戴莹慧'
      console.log(job.value);
      job.value.type='java'
      job.value.salary='25k'
    }

    return {
      name,
      f1,
      job,
    };
  },
};
</script>

<style>
</style>
